package com.lantosec.hmrp.modules.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysBigscreenSqlVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 大屏接口SQL 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysBigscreenSql extends BaseEntity<SysBigscreenSqlVO> {

    private static final long serialVersionUID = 1L;
    public SysBigscreenSql(SysBigscreenSqlVO vo){
        this.sqlName = vo.getSqlName();
        this.sqlContent = vo.getSqlContent();
        this.remark = vo.getRemark();
    }

    @Override
    public SysBigscreenSqlVO convertToVO(){
        return new SysBigscreenSqlVO(this);
    }


    /**
     * SQL名称
     */
    @TableId(value = "sql_name", type = IdType.ASSIGN_UUID)
    private String sqlName;

    /**
     * SQL内容
     */
    private String sqlContent;

    /**
     * 说明信息
     */
    private String remark;

    @TableField(exist = false)
    private Integer flag;

    public enum ColName {
        sql_name, sql_content, remark, 
    }
}
